//package com.ithm.filter;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.CorsRegistry;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
//
//// 接口 WebMvcConfig.....  所有拦截方法
//@Configuration
//class InterceptorConfig extends WebMvcConfigurationSupport {
//    @Bean
//    public TokenInterceptor initAuthInterceptor()
//    {
//        return new TokenInterceptor();
//    }
//
//    @Override
//    public void addInterceptors(InterceptorRegistry registry){
//        registry.addInterceptor(initAuthInterceptor())
////                .addPathPatterns("/**") // 拦截所有路径
////                //放开指定路径
////                .excludePathPatterns("/api/user/login/currentUser")
////                .excludePathPatterns("/api/user/login/account")
////                .excludePathPatterns("/api/jurisdiction/menu")
////                .excludePathPatterns("/api/jurisdiction/menu/path")
////                .excludePathPatterns("/api/user/address/count/list");
//                 .excludePathPatterns("/**");  //放开所有接口路径
//    }
//
//
//    /**
//     * 后台跨域
//     * @param corsRegistry
//     */
//    @Override
//    public void addCorsMappings(CorsRegistry corsRegistry) {
//        corsRegistry.addMapping("/**").allowedOrigins("*").allowedMethods("GET", "POST", "OPTIONS", "PUT")
//                .allowedHeaders("Content-Type", "X-Requested-With", "accept", "Origin", "Access-Control-Request-Method",
//                        "Access-Control-Request-Headers")
//                .exposedHeaders("Access-Control-Allow-Origin", "Access-Control-Allow-Credentials")
//                .allowCredentials(true).maxAge(3600);
//    }
//
//}
